package com.lennon.eoi.executors.export.execl.style.impl;

import org.apache.poi.ss.usermodel.CellStyle;
import org.apache.poi.ss.usermodel.Font;
import org.apache.poi.ss.usermodel.Workbook;
import org.apache.poi.xssf.usermodel.XSSFCellStyle;

import com.lennon.eoi.executors.export.execl.style.ExeclCellStyle;

/**
 * 默认execl 的单元格式
 * 
 * @author lennon
 * @time 2017年8月27日上午9:04:12
 *
 */
public class DefaultUpdateExeclCellStyle extends ExeclCellStyle {

    @Override
    public void create(Workbook workbook) {
        // TODO Auto-generated method stub
        // 创建首行标题字体：粗体
        Font titleFont = workbook.createFont();
        titleFont.setBoldweight(Font.BOLDWEIGHT_BOLD);

        // 四周组边框、左对齐
        styleAlignLeft = (XSSFCellStyle) workbook
                .createCellStyle();
        styleAlignLeft.setAlignment(CellStyle.ALIGN_LEFT);
        styleAlignLeft.setBorderBottom(CellStyle.BORDER_THIN);
        styleAlignLeft.setBorderLeft(CellStyle.BORDER_THIN);
        styleAlignLeft.setBorderRight(CellStyle.BORDER_THIN);
        styleAlignLeft.setBorderTop(CellStyle.BORDER_THIN);

        // 四周组边框、粗体、居中对齐
        styleAlignCenter = (XSSFCellStyle) workbook
                .createCellStyle();
        styleAlignCenter.setAlignment(CellStyle.ALIGN_CENTER);
        styleAlignCenter.setBorderBottom(CellStyle.BORDER_THIN);
        styleAlignCenter.setBorderLeft(CellStyle.BORDER_THIN);
        styleAlignCenter.setBorderRight(CellStyle.BORDER_THIN);
        styleAlignCenter.setBorderTop(CellStyle.BORDER_THIN);

        // 四周组边框、粗体、居中对齐
        styleAlignRight = (XSSFCellStyle) workbook
                .createCellStyle();
        styleAlignRight.setAlignment(CellStyle.ALIGN_RIGHT);
        styleAlignRight.setBorderBottom(CellStyle.BORDER_THIN);
        styleAlignRight.setBorderLeft(CellStyle.BORDER_THIN);
        styleAlignRight.setBorderRight(CellStyle.BORDER_THIN);
        styleAlignRight.setBorderTop(CellStyle.BORDER_THIN);
    }
}
